package org.lyh.base.util;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Result {
    private Boolean success;
    private String msg;
    private Object data;
    //成功
    public static Result success(){
        return new Result(true,null,null);
    }
    //成功并返回数据
    public static Result success(Object data){
        return new Result(true,null,data);
    }
    //失败并返回错误信息
    public static Result error(String msg){
        return new Result(false,msg,null);
    }
}
